package stephen.competition14;

import java.sql.SQLException;

import javax.servlet.http.HttpSession;

public class UserService {
	        static HttpSession session;      
	//用户登录：
		
			public boolean login(String username,String pwd) throws SQLException{
				boolean result=false;
				UserDao d=new UserDao();
				User u=d.getUserByName(username);
				if(pwd.equals(u.getPwd())){
					result=true;
				}
				return  result;
 
		  }
			
			
  //添加评论
			public boolean comment(String username,String comment){
				boolean result=false;
				UserDao d=new UserDao();
				try {
					if(d.addcomment(username,comment)){
						 result=true;
					}
				} catch (SQLException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
				return result;
			}
}